.class public Lcom/melesta/payment/sms/SmsSystem;
.super Ljava/lang/Object;
.source "SmsSystem.java"

# interfaces
.implements Lcom/melesta/payment/interfaces/ISystem;


# static fields
.field static final SYSTEM_NAME:Ljava/lang/String; = "sms"


# instance fields
.field private context:Landroid/content/Context;

.field private defaultListener:Lcom/melesta/payment/interfaces/IListener;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 19
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method static synthetic access$000(Lcom/melesta/payment/sms/SmsSystem;)Lcom/melesta/payment/interfaces/IListener;
    .locals 1
    .parameter "x0"

    .prologue
    .line 19
    iget-object v0, p0, Lcom/melesta/payment/sms/SmsSystem;->defaultListener:Lcom/melesta/payment/interfaces/IListener;

    return-object v0
.end method

.method static synthetic access$100(Lcom/melesta/payment/sms/SmsSystem;)Landroid/content/Context;
    .locals 1
    .parameter "x0"

    .prologue
    .line 19
    iget-object v0, p0, Lcom/melesta/payment/sms/SmsSystem;->context:Landroid/content/Context;

    return-object v0
.end method

.method private updateContext(Landroid/content/Context;)V
    .locals 0
    .parameter "context"

    .prologue
    .line 109
    iput-object p1, p0, Lcom/melesta/payment/sms/SmsSystem;->context:Landroid/content/Context;

    .line 110
    return-void
.end method


# virtual methods
.method public get(Ljava/lang/String;)Ljava/lang/Object;
    .locals 1
    .parameter "property"

    .prologue
    .line 119
    const/4 v0, 0x0

    return-object v0
.end method

.method public getDefaultListener()Lcom/melesta/payment/interfaces/IListener;
    .locals 1

    .prologue
    .line 127
    iget-object v0, p0, Lcom/melesta/payment/sms/SmsSystem;->defaultListener:Lcom/melesta/payment/interfaces/IListener;

    return-object v0
.end method

.method public getName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 75
    const-string v0, "sms"

    return-object v0
.end method

.method public getRequestBuilder()Lcom/melesta/payment/interfaces/IRequestBuilder;
    .locals 1

    .prologue
    .line 70
    new-instance v0, Lcom/melesta/payment/sms/SmsRecuestBuilder;

    invoke-direct {v0, p0}, Lcom/melesta/payment/sms/SmsRecuestBuilder;-><init>(Lcom/melesta/payment/sms/SmsSystem;)V

    return-object v0
.end method

.method public onActivityResult(Landroid/content/Context;IILandroid/content/Intent;)Z
    .locals 1
    .parameter "context"
    .parameter "requestCode"
    .parameter "resultCode"
    .parameter "data"

    .prologue
    .line 132
    const/4 v0, 0x0

    return v0
.end method

.method public onCreate(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 0
    .parameter "context"
    .parameter "handler"

    .prologue
    .line 80
    invoke-direct {p0, p1}, Lcom/melesta/payment/sms/SmsSystem;->updateContext(Landroid/content/Context;)V

    .line 81
    return-void
.end method

.method public onDestroy(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 0
    .parameter "context"
    .parameter "handler"

    .prologue
    .line 85
    invoke-direct {p0, p1}, Lcom/melesta/payment/sms/SmsSystem;->updateContext(Landroid/content/Context;)V

    .line 86
    return-void
.end method

.method public onPause(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 0
    .parameter "context"
    .parameter "handler"

    .prologue
    .line 100
    invoke-direct {p0, p1}, Lcom/melesta/payment/sms/SmsSystem;->updateContext(Landroid/content/Context;)V

    .line 101
    return-void
.end method

.method public onResume(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 0
    .parameter "context"
    .parameter "handler"

    .prologue
    .line 105
    invoke-direct {p0, p1}, Lcom/melesta/payment/sms/SmsSystem;->updateContext(Landroid/content/Context;)V

    .line 106
    return-void
.end method

.method public onStart(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 0
    .parameter "context"
    .parameter "handler"

    .prologue
    .line 90
    invoke-direct {p0, p1}, Lcom/melesta/payment/sms/SmsSystem;->updateContext(Landroid/content/Context;)V

    .line 91
    return-void
.end method

.method public onStop(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 0
    .parameter "context"
    .parameter "handler"

    .prologue
    .line 95
    invoke-direct {p0, p1}, Lcom/melesta/payment/sms/SmsSystem;->updateContext(Landroid/content/Context;)V

    .line 96
    return-void
.end method

.method public purchaseProcessed(Lcom/melesta/payment/PaymentTransaction;)V
    .locals 0
    .parameter "pt"

    .prologue
    .line 139
    return-void
.end method

.method public sendSms(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 9
    .parameter "name"
    .parameter "phoneNumber"
    .parameter "message"

    .prologue
    .line 32
    const-string v6, "SMS_SENT"

    .line 34
    .local v6, SENT:Ljava/lang/String;
    const-string v0, "payment"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "begin sms ("

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, ") to "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 36
    :try_start_0
    new-instance v8, Landroid/content/Intent;

    invoke-direct {v8, v6}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 37
    .local v8, sendIntent:Landroid/content/Intent;
    iget-object v0, p0, Lcom/melesta/payment/sms/SmsSystem;->context:Landroid/content/Context;

    const/4 v1, 0x0

    const/4 v2, 0x0

    invoke-static {v0, v1, v8, v2}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v4

    .line 40
    .local v4, sentPI:Landroid/app/PendingIntent;
    iget-object v0, p0, Lcom/melesta/payment/sms/SmsSystem;->context:Landroid/content/Context;

    new-instance v1, Lcom/melesta/payment/sms/SmsSystem$1;

    invoke-direct {v1, p0, p1}, Lcom/melesta/payment/sms/SmsSystem$1;-><init>(Lcom/melesta/payment/sms/SmsSystem;Ljava/lang/String;)V

    new-instance v2, Landroid/content/IntentFilter;

    invoke-direct {v2, v6}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v1, v2}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    .line 60
    invoke-static {}, Landroid/telephony/SmsManager;->getDefault()Landroid/telephony/SmsManager;

    move-result-object v0

    const/4 v2, 0x0

    const/4 v5, 0x0

    move-object v1, p2

    move-object v3, p3

    invoke-virtual/range {v0 .. v5}, Landroid/telephony/SmsManager;->sendTextMessage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/app/PendingIntent;Landroid/app/PendingIntent;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 66
    .end local v4           #sentPI:Landroid/app/PendingIntent;
    .end local v8           #sendIntent:Landroid/content/Intent;
    :goto_0
    return-void

    .line 63
    :catch_0
    move-exception v7

    .line 64
    .local v7, e:Ljava/lang/Exception;
    const-string v0, "payment - sendSms"

    invoke-static {v0, v7}, Lcom/melesta/engine/Error;->processException(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public bridge synthetic set(Ljava/lang/String;Ljava/lang/Object;)Lcom/melesta/payment/interfaces/ISystem;
    .locals 1
    .parameter "x0"
    .parameter "x1"

    .prologue
    .line 19
    invoke-virtual {p0, p1, p2}, Lcom/melesta/payment/sms/SmsSystem;->set(Ljava/lang/String;Ljava/lang/Object;)Lcom/melesta/payment/sms/SmsSystem;

    move-result-object v0

    return-object v0
.end method

.method public set(Ljava/lang/String;Ljava/lang/Object;)Lcom/melesta/payment/sms/SmsSystem;
    .locals 0
    .parameter "property"
    .parameter "value"

    .prologue
    .line 114
    return-object p0
.end method

.method public setDefaultListener(Lcom/melesta/payment/interfaces/IListener;)V
    .locals 0
    .parameter "defaultListener"

    .prologue
    .line 123
    iput-object p1, p0, Lcom/melesta/payment/sms/SmsSystem;->defaultListener:Lcom/melesta/payment/interfaces/IListener;

    .line 124
    return-void
.end method
